<%@ page language="java" import="java.util.*,java.text.SimpleDateFormat,cn.bupt.adt.constant.Constants" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page  isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String ip = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/";
%>
<%
	//分页
	//currentPage就是当前页，allPages表示的就是一共有多少页。这些在后面都会用到  
	int currentPage = 0, allPages = 0;
	if (request.getAttribute("currentPage") != null) {
		currentPage = Integer.parseInt(request.getAttribute(
				"currentPage").toString());
	}
	if (request.getAttribute("allPages") != null) {
		allPages = Integer.parseInt(request.getAttribute("allPages")
				.toString());
	}
	//本页面url，翻页用
	String url = "checkInstitutionManagement/insDetail";
	request.setAttribute("url", url);
	request.setAttribute("imageRootPath",ip+Constants.IMAGE_PATH);
%>
<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    

	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/bootstrap.min.css" />

    <link href="<%=request.getContextPath()%>/assets/css/font-awesome.css" rel="stylesheet" />
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
	<script src="<%=request.getContextPath()%>/assets/js/jquery-1.10.2.js" type="text/javascript"></script>
	<script  type="text/javascript" src="js/layer/layer.js" ></script>
	<script src="assets/js/bootstrap.js"></script>
	<link rel="stylesheet" href="layerui/css/layui.css"><link>
		<link href="assets/css/bootstrap-fileupload.min.css" rel="stylesheet" />
	 <link rel="stylesheet" href="css/Orderfont.css"><link>
	<script type="text/javascript" src="layerui/layui.js"></script>
	<script type="text/javascript" src="js/public/buttonModal.js"></script>
	<script type="text/javascript" src="js/public/submitForm.js"></script>
	  </head>
  <c:if test="${!empty oper_message }">
  	<script type="text/javascript">
  		alert("${oper_message}");
  	</script>
  </c:if>
  <body>
		  <div class="page-header">
		  		<h1><small>检查机构详情<i class="icon-double-angle-right"></i></small></h1>
			</div>
  	<div class="container">
  				</div>
                        <div class="panel-body">
                            <form method="post" role="form" action="checkInstitutionManagement/modifyIns" class="form-horizontal" enctype="multipart/form-data" >
                                        
                                        <input type="hidden" value="${item.id }" name="id">
                                        <%--名称 --%>
	                                     <div class="form-group">
	                                          <label for="name" class="control-label col-sm-3">名称</label>
	                                          <div class="col-sm-6">
	                                          	<input class="form-control" type="text" name="name" id="name" value="${item.name }"> 
	                                          </div>
	                                      </div>
                                        <%--电话 --%>
	                                     <div class="form-group">
	                                          <label for="phone" class="control-label col-sm-3">电话</label>
	                                          <div class="col-sm-6">
	                                          	<input class="form-control" type="text" name="phone" id="phone" value="${item.phone }"> 
	                                          </div>
	                                      </div>                                        
                                        <%--邮箱--%>
	                                     <div class="form-group">
	                                          <label for="mail" class="control-label col-sm-3">邮箱</label>
	                                          <div class="col-sm-6">
	                                          	<input class="form-control" type="text" name="mail" id="landline" value="${item.mail }"> 
	                                          </div>
	                                      </div> 	                                      
                                        <%--外观照片--%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">外观照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                                <div>
					                                	<button id="bt-appears" class="btn btn-info">查看</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" multiple="multiple" name="appear" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div>
                                        <%--机构营业执照照片 --%>
                                 		<div class="form-group">
					                        <label class="control-label col-sm-3">营业执照照片</label>
					                        <div class="col-sm-3">
					                            <div class="fileupload fileupload-new" data-provides="fileupload">
					                                <div>
					                                	<button id="bt-certs" class="btn btn-info">查看</button>
					                                    <span class="btn btn-file btn-success"><span class="fileupload-new">修改照片</span><span class="fileupload-exists">更改照片</span><input type="file" name="certi" accept="image/*"></span>
					                                    <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">移除</a>
					                                </div>
					                            </div>
					                        </div>	
                                        </div>    
                                                                                                                                                                                                                                                                                                                                                     
                                     		<button  class="btn btn-info" id="sm" >保存信息</button>
                                     		<a class="btn btn-info"  href="checkInstitutionManagement/index/1">返回机构列表</a>
                                    </form>
                                    </div>
                                    
                                    
                                    <%--外观照片 --%>                                      
										<div id="appears" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
								      				<c:forEach var="img" items="${item.appears}" >
								      				<div>
								      					<img alt="外观照片" src="${imageRootPath}${img}" style="height: 100%;width: 100%">
								      					</div>
								      				</c:forEach>
								      				</div>
								      			</div>
								      		</div>
										</div>
                                    <%--营业执照照片 --%>                                      
										<div id="certs" class="modal fade">
								      		<div class="modal-dialog " >
								      			<div class="modal-content">
								      				<div class="modal-header">
								      					 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
								      				</div>
								      				<div class="modal-body">
								      				<div>
								      					<img alt="营业执照照片" src="${imageRootPath}${item.certificationImg}" style="height: 100%;width: 100%">
								      					</div>
								      				</div>
								      			</div>
								      		</div>
										</div>										
                            
	<script type="text/javascript">
			clickButtonToModal("bt-certs","certs");
			clickButtonToModal("bt-appears","appears");
	</script>
<script src="assets/js/bootstrap-fileupload.js"></script>					
  </body>
</html>